extends layout/_layout

append pageCss
    link(rel="stylesheet", href=`${setting.static}static/css/post.css?t=${setting.tstamp}`)

append content
    - const { article, prevItem, nextItem } = data

    main.page__container.page__main
        .page__content
            .post__cover: img(src=article.cover || setting.default_cover, alt=article.title)

            header.post__info
                h1.post__title #{ article.title }
                .post__mark
                    .mark__block
                        i.mark__icon.icon.icon-write
                        .mark__list.clearfix #{article.author}

                    .mark__block
                        i.mark__icon.icon.icon-time
                        .mark__list.clearfix #{article.date || article.createdAt}

                    - var tags = article.tags
                    if tags.length && tags[0].length
                        .mark__block
                            i.mark__icon.icon.icon-tag
                            ul.mark__tags.mark__list.clearfix
                                each tag in tags
                                    li.mark__item
                                        a(href=`/tags/${tag}`) #{tag}

            .post__content !{article.content}
                #separator
                .post-announce !{setting.announce} (
                    a(href=`https://kaiziye.cn/articles?id=${article.path}`) https://kaiziye.cn/articles?id=#{article.path}
                    | )

                if prevItem || nextItem
                    .post__prevs
                        if prevItem
                            .post__prev
                                a(href=`/articles?id=${prevItem.path}`, title=prevItem.title): i.icon.icon-prev
                                    | #{prevItem.title}
                        if nextItem
                            .post__next
                                a(href=`/articles?id=${nextItem.path}`, title=nextItem.title) #{nextItem.title}
                                    i.icon.icon-next

        include _partial/sidebar
